package demo;

public class SleepDemo2_5 {
    public static void main(String[] args) {
        Thread lin = new Thread(){
            public void run(){
                System.out.println("lin:睡一觉!");
                try {
                    Thread.sleep(555555);
                } catch (InterruptedException e) {
                    System.out.println("lin:干嘛呢干么呢都破了相了");
                }
                System.out.println("lin:醒了");
            }
        };
        Thread huang = new Thread(){
            public void run(){
                System.out.println("huang:大锤八十,小锤四十!");
                for (int i = 0; i < 5; i++) {
                    System.out.println("huang:八十!");
                    try {
                        Thread.sleep(1000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
                System.out.println("huang:咣当!");
                System.out.println("huang:大哥搞定!");
                lin.interrupt();
            }
        };
        lin.start();
        huang.start();
    }
}
